/**
 * 
 */
package com.otrace.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.otrace.service.SequenceGenerationService;
import com.sun.jdi.VirtualMachine;

/**
 * @author kvn prabhu
 *
 */
public class SequenceGenAction extends Action {
	VirtualMachine vm;
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		HttpSession session  = request.getSession(false);
		String eventFlowXML ="";
		vm = (VirtualMachine)session.getValue("JVM");
		if(vm!=null){
			
			SequenceGenerationService seqGenService = new SequenceGenerationService();
			eventFlowXML =  seqGenService.allEventCapture(vm);
			request.setAttribute("eventFlowXML", eventFlowXML);
			
		}
		return mapping.findForward("success");
	}

}
